import {Navigate,useRoutes} from "react-router-dom"
import Home from '../pages/home'
import Login from '../pages/login'
import Student from '../pages/home/student'
import Admin from '../pages/home/admin'
import Notice from '../pages/home/notice'

const Routers=()=>useRoutes([
    {
        path:'*',
        element:<Navigate to='/'/>
    },
    {
        path:'/',
        element:<Navigate to='/login'/>
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
        path:'/home',
        element:<Home/>,
        children:[
            {
                index:'index',
                element:<Notice/>
            },
            {
                path:'student',
                element:<Student/>
            },
            {
                path:'admin',
                element:<Admin/>
            }
        ]
    }
])

export default Routers